#include <iostream>
#include <windows.h>
#include <tchar.h>

#include "Chess.h"

int main(int argc, char* args[])
{
	// Standard input/output/error file pointers
	FILE *fpStdIn, *fpStdOut, *fpStdErr;

	#define DEBUG
	#if defined(DEBUG) | defined(_DEBUG)
		_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );

		if(AllocConsole())
		{
			// Assign the stdin/stdout/stderr streams to the newly created console
			_tfreopen_s(&fpStdIn, _T("CONIN$"), _T("r"), stdin);
			_tfreopen_s(&fpStdOut, _T("CONOUT$"), _T("w"), stdout);
			_tfreopen_s(&fpStdErr, _T("CONOUT$"), _T("w"), stderr);
		}
	#endif

	SDLEngine::GetInstance()->Initialize("SDLTest", 640, 480);
	SDL_Surface* screen = SDLEngine::GetInstance()->GetScreen();

	Chess* chess = new Chess();

	SDLEngine::GetInstance()->Run();
	SDLEngine::GetInstance()->Kill();
	return 0;
}